package com.yueka.mapper;

import com.yueka.pojo.activity.Activity;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ActivityMapper {

    List<Activity> list(String activityName, String status, String isBanner);
    @Delete("delete from activity where id = #{id}")
    void delete(Integer id);
    @Insert("insert into activity(activity_name, description, status, is_banner, create_time, update_time, avatar) values(#{activityName}, #{description}, #{status}, #{isBanner}, #{createTime}, #{updateTime}, #{avatar})")
    void insert(Activity activity);
    @Update("update activity set activity_name = #{activityName}, avatar = #{avatar}, description = #{description}, status = #{status}, is_banner = #{isBanner}, update_time = #{updateTime} where id = #{id}")
    void update(Activity activity);

    @Select("select id, activity_name, status, is_banner, description, create_time, update_time, avatar from activity where status = '1' and is_banner = '1'")
    List<Activity> getBanners();
    @Select("select id, activity_name, status, is_banner, description, create_time, update_time, avatar from activity where status = '1' and is_banner = '0'")
    List<Activity> getActivityWebList();
}
